/*=============================================================================

MOTION CONTROL CONFIGURATION

FILE: HMot_cfg.cpp

DESCRIPTION

Motion Control configuration

EXTERNALIZED FUNCTIONS


Copyright (c) DaeSung Engineering Inc. All rights reserved.

=============================================================================*/
/*=============================================================================

EDIT HISTORY

---------  -------  -------------------------------------------------------
when       who       what, where, why
---------  -------  -------------------------------------------------------
07/15/04   nso4th    Initial version

=============================================================================*/

/*=============================================================================
HEADER INCLUSION
=============================================================================*/
#include <Cust_AppDef.h>
#include "HMot_cfg.h"

/*=============================================================================
CONSTATN DEFINITION
=============================================================================*/
/*-------------------------------------------------------------------
AXIS TABLE
-------------------------------------------------------------------*/

#define MCFG_AXIS_NUM				(7)
#define MCFG_AXIS_REAL_NUM		(7)

static int32	gaxTbl[MCFG_AXIS_REAL_NUM] = {MOT_AXIS_0, MOT_AXIS_1, MOT_AXIS_2, MOT_AXIS_3, MOT_AXIS_4, MOT_AXIS_5, MOT_AXIS_6};


/*-------------------------------------------------------------------
AXIS INFORMATION
-------------------------------------------------------------------*/
//---- AXIS 0
#define MOTAXIS0_ACTUAL_PER_PULSE		(0.0001) // 0.5 um

#define MOTAXIS0_HOME_SPEED				(30.0)
#define MOTAXIS0_HOME_ACCEL				(20.0)
#define MOTAXIS0_HOME_DISTNLMTORG		(30.0)  // 30 mm
#define MOTAXIS0_ZERO_OFFSET				(10.0)

static motdev_axis_s	gaxCFG_0 = {
#ifdef TG_SYSMGR_SIMUL
	MOTDEV_EMULATOR, // devID
#else
	MOTDEV_AXT_CAMCQI, // devID
#endif
		"", //devStr
		0, // devSubID,
		MOT_AXIS_0, // devModID(= AXIS ID),
		MOTAXIS0_ACTUAL_PER_PULSE, // actPerPulse : mm per one pulse
		MOTAXIS0_HOME_SPEED, // homeSpeed
		MOTAXIS0_HOME_ACCEL, // homeAccel
		MOTAXIS0_HOME_DISTNLMTORG, //homeDistNlmtOrg
		MOTAXIS0_ZERO_OFFSET, // homeZeroOffset
		//-- Signal Level
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_A_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_B_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_INDEX_P

		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_PLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_NLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ALARM_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ORIGIN_P

		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_SERVO_ON_P
		MOTDEV_ACTIVE_LOW,  // MOTDEV_SIG_LEVEL_ALARM_CLEAR_P
		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_INPOSITION_P

		//--- Motion Control
		MOTDEV_OPEN_LOOP, // MOTDEV_CONTROL_MODE_P
		MOTDEV_CONOUT_PULSE, // MOTDEV_CONOUT_TYPE_P
		MOTDEV_PULSEOUT_TWO_HIGH_CWCCW, // MOTDEV_PULSE_METHOD_P
		MOTDEV_ENCSRC_INCREMENTAL, // MOTDEV_ENC_SOURCE_P
		__DONT_CARE__, // MOTDEV_ENC_CAPTURE_P

		MOTDEV_ENCINPUT_4x, // MOTDEV_ENC_INPUT_P
		MOTDEV_MOTCOMPLETE_ACTUAL, // MOTDEV_MOTIONCOMPLETE_MODE_P
		//--- Limit switch
		FALSE, // MOTDEV_LIMITSWITCH_MODE_P
		MOT_PULSEUNIT((-250000.0), MOTAXIS0_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_NEG_P
		MOT_PULSEUNIT((250000.0), MOTAXIS0_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_POS_P
		FALSE, // MOTDEV_SWLIMIT_STOP_P
		//--- Dynamic
		MOTDEV_PRO_TRAPEZOIDAL, // MOTDEV_PROFILE_MODE_P
		__DONT_CARE__, // MOTDEV_EGEAR_SETUP_P (Use the Custom paramter to set E-Gear)
		// Custom Paramters
		MOTCFG_CUST_NUM /* prmCustNum (= 32)*/,
	{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};

//---- AXIS 1
#define MOTAXIS1_ACTUAL_PER_PULSE		(0.0001)

#define MOTAXIS1_HOME_SPEED				(30.0)
#define MOTAXIS1_HOME_ACCEL				(20.0)
#define MOTAXIS1_HOME_DISTNLMTORG		(30.0)  // 30 mm
#define MOTAXIS1_ZERO_OFFSET				(10.0)

	static motdev_axis_s	gaxCFG_1 = {
#ifdef TG_SYSMGR_SIMUL
		MOTDEV_EMULATOR, // devID
#else
		MOTDEV_AXT_CAMCQI, // devID
#endif
			"", //devStr
			0, // devSubID,
			MOT_AXIS_1, // devModID(= AXIS ID),
			MOTAXIS1_ACTUAL_PER_PULSE, // actPerPulse : mm per one pulse
			MOTAXIS1_HOME_SPEED, // homeSpeed
			MOTAXIS1_HOME_ACCEL, // homeAccel
			MOTAXIS1_HOME_DISTNLMTORG, //homeDistNlmtOrg
			MOTAXIS1_ZERO_OFFSET, // homeZeroOffset
			//-- Signal Level
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_A_P
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_B_P
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_INDEX_P

			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_PLIMIT_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_NLIMIT_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ALARM_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ORIGIN_P

			MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_SERVO_ON_P
			MOTDEV_ACTIVE_LOW,  // MOTDEV_SIG_LEVEL_ALARM_CLEAR_P
			MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_INPOSITION_P

			//--- Motion Control
			MOTDEV_OPEN_LOOP, // MOTDEV_CONTROL_MODE_P
			MOTDEV_CONOUT_PULSE, // MOTDEV_CONOUT_TYPE_P
			MOTDEV_PULSEOUT_TWO_HIGH_CWCCW, // MOTDEV_PULSE_METHOD_P
			MOTDEV_ENCSRC_INCREMENTAL, // MOTDEV_ENC_SOURCE_P
			__DONT_CARE__, // MOTDEV_ENC_CAPTURE_P

			MOTDEV_ENCINPUT_4x, // MOTDEV_ENC_INPUT_P
			MOTDEV_MOTCOMPLETE_ACTUAL, // MOTDEV_MOTIONCOMPLETE_MODE_P
			//--- Limit switch
			FALSE, // MOTDEV_LIMITSWITCH_MODE_P
			MOT_PULSEUNIT((-250000.0), MOTAXIS1_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_NEG_P
			MOT_PULSEUNIT((250000.0), MOTAXIS1_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_POS_P
			FALSE, // MOTDEV_SWLIMIT_STOP_P
			//--- Dynamic
			MOTDEV_PRO_TRAPEZOIDAL, // MOTDEV_PROFILE_MODE_P
			__DONT_CARE__, // MOTDEV_EGEAR_SETUP_P (Use the Custom paramter to set E-Gear)
			// Custom Paramters
			MOTCFG_CUST_NUM /* prmCustNum (= 32)*/,
		{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};

//---- AXIS 2
#define MOTAXIS2_ACTUAL_PER_PULSE		(0.0001) // 0.5 um

#define MOTAXIS2_HOME_SPEED				(30.0)
#define MOTAXIS2_HOME_ACCEL				(20.0)
#define MOTAXIS2_HOME_DISTNLMTORG		(30.0)  // 30 mm
#define MOTAXIS2_ZERO_OFFSET				(10.0)

static motdev_axis_s	gaxCFG_2 = {
#ifdef TG_SYSMGR_SIMUL
	MOTDEV_EMULATOR, // devID
#else
	MOTDEV_AXT_CAMCQI, // devID
#endif
		"", //devStr
		0, // devSubID,
		MOT_AXIS_2, // devModID(= AXIS ID),
		MOTAXIS2_ACTUAL_PER_PULSE, // actPerPulse : mm per one pulse
		MOTAXIS2_HOME_SPEED, // homeSpeed
		MOTAXIS2_HOME_ACCEL, // homeAccel
		MOTAXIS2_HOME_DISTNLMTORG, //homeDistNlmtOrg
		MOTAXIS2_ZERO_OFFSET, // homeZeroOffset
		//-- Signal Level
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_A_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_B_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_INDEX_P

		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_PLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_NLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ALARM_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ORIGIN_P

		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_SERVO_ON_P
		MOTDEV_ACTIVE_LOW,  // MOTDEV_SIG_LEVEL_ALARM_CLEAR_P
		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_INPOSITION_P

		//--- Motion Control
		MOTDEV_OPEN_LOOP, // MOTDEV_CONTROL_MODE_P
		MOTDEV_CONOUT_PULSE, // MOTDEV_CONOUT_TYPE_P
		MOTDEV_PULSEOUT_TWO_HIGH_CWCCW, // MOTDEV_PULSE_METHOD_P
		MOTDEV_ENCSRC_INCREMENTAL, // MOTDEV_ENC_SOURCE_P
		__DONT_CARE__, // MOTDEV_ENC_CAPTURE_P

		MOTDEV_ENCINPUT_4x, // MOTDEV_ENC_INPUT_P
		MOTDEV_MOTCOMPLETE_ACTUAL, // MOTDEV_MOTIONCOMPLETE_MODE_P
		//--- Limit switch
		FALSE, // MOTDEV_LIMITSWITCH_MODE_P
		MOT_PULSEUNIT((-250000.0), MOTAXIS2_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_NEG_P
		MOT_PULSEUNIT((250000.0), MOTAXIS2_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_POS_P
		FALSE, // MOTDEV_SWLIMIT_STOP_P
		//--- Dynamic
		MOTDEV_PRO_TRAPEZOIDAL, // MOTDEV_PROFILE_MODE_P
		__DONT_CARE__, // MOTDEV_EGEAR_SETUP_P (Use the Custom paramter to set E-Gear)
		// Custom Paramters
		MOTCFG_CUST_NUM /* prmCustNum (= 32)*/,
	{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};

//---- AXIS 3
#define MOTAXIS3_ACTUAL_PER_PULSE		(0.0001)

#define MOTAXIS3_HOME_SPEED				(30.0)
#define MOTAXIS3_HOME_ACCEL				(20.0)
#define MOTAXIS3_HOME_DISTNLMTORG		(30.0)  // 30 mm
#define MOTAXIS3_ZERO_OFFSET				(10.0)

	static motdev_axis_s	gaxCFG_3 = {
#ifdef TG_SYSMGR_SIMUL
		MOTDEV_EMULATOR, // devID
#else
		MOTDEV_AXT_CAMCQI, // devID
#endif
			"", //devStr
			0, // devSubID,
			MOT_AXIS_3, // devModID(= AXIS ID),
			MOTAXIS3_ACTUAL_PER_PULSE, // actPerPulse : mm per one pulse
			MOTAXIS3_HOME_SPEED, // homeSpeed
			MOTAXIS3_HOME_ACCEL, // homeAccel
			MOTAXIS3_HOME_DISTNLMTORG, //homeDistNlmtOrg
			MOTAXIS3_ZERO_OFFSET, // homeZeroOffset
			//-- Signal Level
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_A_P
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_B_P
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_INDEX_P

			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_PLIMIT_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_NLIMIT_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ALARM_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ORIGIN_P

			MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_SERVO_ON_P
			MOTDEV_ACTIVE_LOW,  // MOTDEV_SIG_LEVEL_ALARM_CLEAR_P
			MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_INPOSITION_P

			//--- Motion Control
			MOTDEV_OPEN_LOOP, // MOTDEV_CONTROL_MODE_P
			MOTDEV_CONOUT_PULSE, // MOTDEV_CONOUT_TYPE_P
			MOTDEV_PULSEOUT_TWO_HIGH_CWCCW, // MOTDEV_PULSE_METHOD_P
			MOTDEV_ENCSRC_INCREMENTAL, // MOTDEV_ENC_SOURCE_P
			__DONT_CARE__, // MOTDEV_ENC_CAPTURE_P

			MOTDEV_ENCINPUT_4x, // MOTDEV_ENC_INPUT_P
			MOTDEV_MOTCOMPLETE_ACTUAL, // MOTDEV_MOTIONCOMPLETE_MODE_P
			//--- Limit switch
			FALSE, // MOTDEV_LIMITSWITCH_MODE_P
			MOT_PULSEUNIT((-250000.0), MOTAXIS3_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_NEG_P
			MOT_PULSEUNIT((250000.0), MOTAXIS3_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_POS_P
			FALSE, // MOTDEV_SWLIMIT_STOP_P
			//--- Dynamic
			MOTDEV_PRO_TRAPEZOIDAL, // MOTDEV_PROFILE_MODE_P
			__DONT_CARE__, // MOTDEV_EGEAR_SETUP_P (Use the Custom paramter to set E-Gear)
			// Custom Paramters
			MOTCFG_CUST_NUM /* prmCustNum (= 32)*/,
		{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};

//---- AXIS 4
#define MOTAXIS4_ACTUAL_PER_PULSE		(0.0001) // 0.5 um

#define MOTAXIS4_HOME_SPEED				(30.0)
#define MOTAXIS4_HOME_ACCEL				(20.0)
#define MOTAXIS4_HOME_DISTNLMTORG		(30.0)  // 30 mm
#define MOTAXIS4_ZERO_OFFSET				(10.0)

static motdev_axis_s	gaxCFG_4 = {
#ifdef TG_SYSMGR_SIMUL
	MOTDEV_EMULATOR, // devID
#else
	MOTDEV_AXT_CAMCQI, // devID
#endif
		"", //devStr
		0, // devSubID,
		MOT_AXIS_4, // devModID(= AXIS ID),
		MOTAXIS4_ACTUAL_PER_PULSE, // actPerPulse : mm per one pulse
		MOTAXIS4_HOME_SPEED, // homeSpeed
		MOTAXIS4_HOME_ACCEL, // homeAccel
		MOTAXIS4_HOME_DISTNLMTORG, //homeDistNlmtOrg
		MOTAXIS4_ZERO_OFFSET, // homeZeroOffset
		//-- Signal Level
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_A_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_B_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_INDEX_P

		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_PLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_NLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ALARM_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ORIGIN_P

		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_SERVO_ON_P
		MOTDEV_ACTIVE_LOW,  // MOTDEV_SIG_LEVEL_ALARM_CLEAR_P
		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_INPOSITION_P

		//--- Motion Control
		MOTDEV_OPEN_LOOP, // MOTDEV_CONTROL_MODE_P
		MOTDEV_CONOUT_PULSE, // MOTDEV_CONOUT_TYPE_P
		MOTDEV_PULSEOUT_TWO_HIGH_CWCCW, // MOTDEV_PULSE_METHOD_P
		MOTDEV_ENCSRC_INCREMENTAL, // MOTDEV_ENC_SOURCE_P
		__DONT_CARE__, // MOTDEV_ENC_CAPTURE_P

		MOTDEV_ENCINPUT_4x, // MOTDEV_ENC_INPUT_P
		MOTDEV_MOTCOMPLETE_ACTUAL, // MOTDEV_MOTIONCOMPLETE_MODE_P
		//--- Limit switch
		FALSE, // MOTDEV_LIMITSWITCH_MODE_P
		MOT_PULSEUNIT((-250000.0), MOTAXIS4_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_NEG_P
		MOT_PULSEUNIT((250000.0), MOTAXIS4_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_POS_P
		FALSE, // MOTDEV_SWLIMIT_STOP_P
		//--- Dynamic
		MOTDEV_PRO_TRAPEZOIDAL, // MOTDEV_PROFILE_MODE_P
		__DONT_CARE__, // MOTDEV_EGEAR_SETUP_P (Use the Custom paramter to set E-Gear)
		// Custom Paramters
		MOTCFG_CUST_NUM /* prmCustNum (= 32)*/,
	{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};

//---- AXIS 5
#define MOTAXIS5_ACTUAL_PER_PULSE		(0.0001)

#define MOTAXIS5_HOME_SPEED				(30.0)
#define MOTAXIS5_HOME_ACCEL				(20.0)
#define MOTAXIS5_HOME_DISTNLMTORG		(30.0)  // 30 mm
#define MOTAXIS5_ZERO_OFFSET				(10.0)

	static motdev_axis_s	gaxCFG_5 = {
#ifdef TG_SYSMGR_SIMUL
		MOTDEV_EMULATOR, // devID
#else
		MOTDEV_AXT_CAMCQI, // devID
#endif
			"", //devStr
			0, // devSubID,
			MOT_AXIS_5, // devModID(= AXIS ID),
			MOTAXIS5_ACTUAL_PER_PULSE, // actPerPulse : mm per one pulse
			MOTAXIS5_HOME_SPEED, // homeSpeed
			MOTAXIS5_HOME_ACCEL, // homeAccel
			MOTAXIS5_HOME_DISTNLMTORG, //homeDistNlmtOrg
			MOTAXIS5_ZERO_OFFSET, // homeZeroOffset
			//-- Signal Level
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_A_P
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_B_P
			__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_INDEX_P

			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_PLIMIT_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_NLIMIT_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ALARM_P
			MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ORIGIN_P

			MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_SERVO_ON_P
			MOTDEV_ACTIVE_LOW,  // MOTDEV_SIG_LEVEL_ALARM_CLEAR_P
			MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_INPOSITION_P

			//--- Motion Control
			MOTDEV_OPEN_LOOP, // MOTDEV_CONTROL_MODE_P
			MOTDEV_CONOUT_PULSE, // MOTDEV_CONOUT_TYPE_P
			MOTDEV_PULSEOUT_TWO_HIGH_CWCCW, // MOTDEV_PULSE_METHOD_P
			MOTDEV_ENCSRC_INCREMENTAL, // MOTDEV_ENC_SOURCE_P
			__DONT_CARE__, // MOTDEV_ENC_CAPTURE_P

			MOTDEV_ENCINPUT_4x, // MOTDEV_ENC_INPUT_P
			MOTDEV_MOTCOMPLETE_ACTUAL, // MOTDEV_MOTIONCOMPLETE_MODE_P
			//--- Limit switch
			FALSE, // MOTDEV_LIMITSWITCH_MODE_P
			MOT_PULSEUNIT((-250000.0), MOTAXIS5_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_NEG_P
			MOT_PULSEUNIT((250000.0), MOTAXIS5_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_POS_P
			FALSE, // MOTDEV_SWLIMIT_STOP_P
			//--- Dynamic
			MOTDEV_PRO_TRAPEZOIDAL, // MOTDEV_PROFILE_MODE_P
			__DONT_CARE__, // MOTDEV_EGEAR_SETUP_P (Use the Custom paramter to set E-Gear)
			// Custom Paramters
			MOTCFG_CUST_NUM /* prmCustNum (= 32)*/,
		{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
		0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};

//---- AXIS 6
#define MOTAXIS6_ACTUAL_PER_PULSE		(0.0001) // 0.5 um

#define MOTAXIS6_HOME_SPEED				(30.0)
#define MOTAXIS6_HOME_ACCEL				(20.0)
#define MOTAXIS6_HOME_DISTNLMTORG		(30.0)  // 30 mm
#define MOTAXIS6_ZERO_OFFSET				(10.0)

static motdev_axis_s	gaxCFG_6 = {
#ifdef TG_SYSMGR_SIMUL
	MOTDEV_EMULATOR, // devID
#else
	MOTDEV_AXT_CAMCQI, // devID
#endif
		"", //devStr
		0, // devSubID,
		MOT_AXIS_6, // devModID(= AXIS ID),
		MOTAXIS6_ACTUAL_PER_PULSE, // actPerPulse : mm per one pulse
		MOTAXIS6_HOME_SPEED, // homeSpeed
		MOTAXIS6_HOME_ACCEL, // homeAccel
		MOTAXIS6_HOME_DISTNLMTORG, //homeDistNlmtOrg
		MOTAXIS6_ZERO_OFFSET, // homeZeroOffset
		//-- Signal Level
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_A_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_B_P
		__DONT_CARE__, // MOTDEV_SIG_LEVEL_ENC_INDEX_P

		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_PLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_NLIMIT_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ALARM_P
		MOTDEV_ACTIVE_LOW, // MOTDEV_SIG_LEVEL_ORIGIN_P

		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_SERVO_ON_P
		MOTDEV_ACTIVE_LOW,  // MOTDEV_SIG_LEVEL_ALARM_CLEAR_P
		MOTDEV_ACTIVE_HIGH, // MOTDEV_SIG_LEVEL_INPOSITION_P

		//--- Motion Control
		MOTDEV_OPEN_LOOP, // MOTDEV_CONTROL_MODE_P
		MOTDEV_CONOUT_PULSE, // MOTDEV_CONOUT_TYPE_P
		MOTDEV_PULSEOUT_TWO_HIGH_CWCCW, // MOTDEV_PULSE_METHOD_P
		MOTDEV_ENCSRC_INCREMENTAL, // MOTDEV_ENC_SOURCE_P
		__DONT_CARE__, // MOTDEV_ENC_CAPTURE_P

		MOTDEV_ENCINPUT_4x, // MOTDEV_ENC_INPUT_P
		MOTDEV_MOTCOMPLETE_ACTUAL, // MOTDEV_MOTIONCOMPLETE_MODE_P
		//--- Limit switch
		FALSE, // MOTDEV_LIMITSWITCH_MODE_P
		MOT_PULSEUNIT((-250000.0), MOTAXIS6_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_NEG_P
		MOT_PULSEUNIT((250000.0), MOTAXIS6_ACTUAL_PER_PULSE), // MOTDEV_SWLIMIT_POS_P
		FALSE, // MOTDEV_SWLIMIT_STOP_P
		//--- Dynamic
		MOTDEV_PRO_TRAPEZOIDAL, // MOTDEV_PROFILE_MODE_P
		__DONT_CARE__, // MOTDEV_EGEAR_SETUP_P (Use the Custom paramter to set E-Gear)
		// Custom Paramters
		MOTCFG_CUST_NUM /* prmCustNum (= 32)*/,
	{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \
	0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};

/*=============================================================================
EXTERNALIZED FUNCION DEFINITION
=============================================================================*/
motdev_cfg_s *motdev_default_alloc(void)
{
	motdev_cfg_s	*pCFG;

	pCFG = (motdev_cfg_s*)memCalloc(sizeof(*pCFG));

	// AXIS NUM
	pCFG->axNum = MCFG_AXIS_REAL_NUM;
	pCFG->axRnum = MCFG_AXIS_REAL_NUM;

	// AXIS TABLE
	pCFG->axTbl = (int32*)memCalloc(sizeof(gaxTbl));
	memCopy(pCFG->axTbl, gaxTbl, sizeof(gaxTbl));

	//----------------------------------
	// AXIS CONFIGURATION
	//----------------------------------
	pCFG->pAXIS = (motdev_axis_s*)memCalloc(sizeof(*(pCFG->pAXIS)) * (pCFG->axRnum));

	memCopy((pCFG->pAXIS + MOT_AXIS_0), &gaxCFG_0, sizeof(gaxCFG_0));
	memCopy((pCFG->pAXIS + MOT_AXIS_1), &gaxCFG_1, sizeof(gaxCFG_1));
	memCopy((pCFG->pAXIS + MOT_AXIS_2), &gaxCFG_2, sizeof(gaxCFG_2));
	memCopy((pCFG->pAXIS + MOT_AXIS_3), &gaxCFG_3, sizeof(gaxCFG_3));
	memCopy((pCFG->pAXIS + MOT_AXIS_4), &gaxCFG_4, sizeof(gaxCFG_4));
	memCopy((pCFG->pAXIS + MOT_AXIS_5), &gaxCFG_5, sizeof(gaxCFG_5));
	memCopy((pCFG->pAXIS + MOT_AXIS_6), &gaxCFG_6, sizeof(gaxCFG_6));

	return	pCFG;
}

void motdev_default_free(motdev_cfg_s *cfg)
{
	if(cfg == NULL)
		return;
	if(cfg->axTbl)
	{
		memFree(cfg->axTbl);
		cfg->axTbl = NULL;
	}

	if(cfg->pAXIS)
	{
		memFree(cfg->pAXIS);
		cfg->pAXIS = NULL;
	}
	motdev_cfg_free(cfg);
}

/*--- END OF MOT_CFG.C ---*/
